<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
        $orderId=$_REQUEST['orderId'];
        //$user_id=54;
        //$orderId=124;
		$sql="select * from `".$oto."_orders`,`".$oto."_order_goods`,`".$oto."_shops` where ".$oto."_orders.userId='".$user_id."' and `orderFlag`='1' and ".$oto."_orders.orderId=".$oto."_order_goods.orderId and ".$oto."_shops.shopId=".$oto."_orders.shopId and ".$oto."_orders.orderId='$orderId'";
		//echo $sql;
		//die();
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$person_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		// if(isset($person_info))
		// {
		// 	for($i=0;$i<count($person_info);$i++)
		// 	{
		// 		if($person_info[$i]['orderStatus']==4 || $person_info[$i]['orderStatus']=='4')
		// 		{
		// 			$goods_id=$person_info[$i]['goodsId'];
		// 			$order_id=$person_info[$i]['orderId'];
		// 			$sql="select * from `".$oto."_share` where orderId='{$order_id}' and goodsId='{$goods_id}' and userId='{$user_id}'";
		// 			$result=$db->query($sql);
		// 			while($row=$result->fetch_assoc()){
		// 				$pingjia_info[$i][]=$row;//将取得的所有数据赋值给person_info数组
		// 			}
		// 			$sql="select * from `".$oto."_goods_appraises` where orderId='{$order_id}' and goodsId='{$goods_id}' and userId='{$user_id}'";
		// 			$result=$db->query($sql);
		// 			while($row=$result->fetch_assoc()){
		// 				$appraises_info[$i][]=$row;//将取得的所有数据赋值给person_info数组
		// 			}
		// 			if(!isset($pingjia_info[$i]) && isset($appraises_info[$i]))
		// 			{
		// 				$person_info[$i]['pingjia_pan']=1;
		// 			}
		// 			else if(!isset($appraises_info[$i]))
		// 			{
		// 				$person_info[$i]['pingjia_pan']=0;
		// 			}
		// 			else if(isset($pingjia_info[$i]) && isset($appraises_info[$i]))
		// 			{
		// 				$person_info[$i]['pingjia_pan']=2;
		// 			}
		// 		}
		// 	}
			
		// }
		echo json_encode($person_info);
?>